﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.ObjectModel;
using System.Windows.Media.Imaging;

namespace STEditor.Classes.Tests
{
    [TestClass]
    public class STGameTests
    {

        private STGame _game = null;

        [TestInitialize]
        public void Initialize()
        {
            _game = new STGame();
        }

        [TestMethod]
        public void STGame_Should_Have_Game_Areas_Property()
        {

            Assert.IsInstanceOfType(_game.GameAreas, typeof(ObservableCollection<STGameArea>), "GameAreas is not an ObservableCollection<GameArea>");

        }

        [TestMethod]
        public void STGame_Should_Have_TileTypes_Property()
        {

            Assert.IsInstanceOfType(_game.TileTypes, typeof(STTileImageCollection), "TileTypes is not an ObservableCollection<BitmapImage>");

        }

        [TestMethod]
        public void STGame_Should_Have_Current_Area_Property()
        {

            var gameArea = new STGameArea();
            _game.CurrentArea = gameArea;

            Assert.AreSame(gameArea, _game.CurrentArea, "CurrentArea was not set properly");

        }

        [TestMethod]
        public void STGame_Should_Set_The_Current_Area_To_The_First_Game_Area_Added()
        {

            var area1 = new STGameArea();
            var area2 = new STGameArea();
            _game.GameAreas.Add(area1);
            _game.GameAreas.Add(area2);

            Assert.AreSame(area1, _game.CurrentArea, "CurrentArea was not set to the first area added");

        }

    }
}
